package com.peace.hospital.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peace.hospital.entity.hospitalization.entity.Doctoradvice;
import com.peace.hospital.entity.hospitalization.entity.People;
import com.peace.hospital.mapper.DoctoradviceMapper;
import com.peace.hospital.service.IDoctoradviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  医嘱实现类
 * </p>
 *
 * @author xie
 * @since 2019-11-06
 */
@Service
public class DoctoradviceServiceImpl extends ServiceImpl<DoctoradviceMapper, Doctoradvice> implements IDoctoradviceService {

    @Autowired
    private DoctoradviceMapper doctoradviceMapper;
    @Override
    public boolean insertdoctorAdvice(Doctoradvice doctoradvice) {
        if (doctoradviceMapper.insertDoctorAdvice(doctoradvice)==1)
        return true;
        else
            return false;
    }

    @Override

    public boolean deleteDoctorAdvice(Doctoradvice doctoradvice) {
        System.out.println(doctoradviceMapper.deleteDoctorAdvice(doctoradvice.getDoctoradviceid()));
        return (doctoradviceMapper.deleteDoctorAdvice(doctoradvice.getDoctoradviceid())!=0);
    }

    @Override
    public Doctoradvice selectAdvice(People people) {
        return doctoradviceMapper.selectAdvice(people);
    }
}
